package com.code.demo.okgo;

import android.app.Activity;

import com.code.demo.ui.common.ToastFactory;
import com.lzy.okgo.model.Response;

/**
 * Created by android on 2018/11/30.
 */

public class OkGoResponse {

    public static String getBody(Activity activity, Response<String> response) {

        if (response == null || response.body() == null) {
            ToastFactory.showToast(activity, "请求失败");
            return null;
        }

        return response.body();
    }
}
